<template>
  <div>
    <p>这是登录页-</p>
    <button @click="authLogin">授权登录</button>
  </div>
</template>
~

<script setup name="login">
import { ACCESS_TOKEN, HOME_PAGE_PATH } from '@/mutation-type';
import { webStorage } from '@/utils/webStorage';
import { useUserStore } from '@/store/user';
import router from '@/router';
const authLogin = () => {
  let user = useUserStore();
  let userInfo = { name: 'liaozhiyang', age: 18, sex: 'man' };
  user.setUser(userInfo);
  webStorage.ls.set(ACCESS_TOKEN, userInfo, 2 * 24 * 60 * 60 * 1000);
  router.push(HOME_PAGE_PATH);
};
</script>

<style lang="less" scoped></style>

